﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using gfLibrary;
namespace IYAKASAPortal
{
    public partial class frame_top : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] != null && Session["UserName"].ToString() != "")
            {
                string userName = Session["UserName"].ToString();

                var v = IYAKASAPortal.Services.UserAuthority.GetUserAuthority(userName);
                lbl_oname.Text = "["+userName+"]" + v.UserName;

                switch (v.UserPower)
                {
                    case "1":
                        lbl_rname.Text = "监督部门";
                        break;
                    case "2":
                        lbl_rname.Text = "站长";
                        break;
                    case "3":
                        lbl_rname.Text = "管理员";
                        break;
                    case "4":
                        lbl_rname.Text = "设备管理员";
                        break;
                    case "5":
                        lbl_rname.Text = "操作员";
                        break;
                    case "0":
                        lbl_rname.Text = "厂家人员";
                        break;
                    default:
                        lbl_rname.Text = "无权限";
                        break;
                }
            }
            else
            {
                gfJs.RunFunction(this.Page, "parent.window.location = 'logout.aspx';");
            }
        }
    }
}
